← Back
Editing: add-sqlite.js
import{c as a,r as e,G as s,q as l,v as t,e as o,A as r,H as m,x as i,Q as d,aa as p,a8 as n}from"./base-lib.js?v=1765440387";import{K as u,j as c,e as f}from"./utils-lib.js?v=1765440387";import{_ as h}from"./index91.js?v=1765440387";import{g as _,ai as j}from"./database.js?v=1765440387";import{f as b}from"./validator.js?v=1765440387";import"./__commonjsHelpers__.js?v=1765440387";import"./index94.js?v=1765440387";import"./column.js?v=1765440387";const v={class:"p-24px"},g=f(a({__name:"add-sqlite",setup(a,{expose:f}){const{refreshTableList:g}=_(),x=e(),V=e({name:"",path:""}),q={path:[{required:!0,message:"请选择数据库文件",trigger:["blur","change"]}]},w=()=>{b({type:"file",path:"",change:a=>V.value.path=a})};return f({onConfirm:async a=>{await x.value.validate(),await u({loading:"正在添加数据库,请稍后...",request:j(V.value,"sqlite"),message:!0}),g(),a()}}),(a,e)=>{const u=h,f=p,_=c,j=n,b=s("trim");return l(),t("div",v,[o(j,{model:i(V),ref_key:"addDataBaseForm",ref:x,rules:q,onSubmit:e[2]||(e[2]=d(()=>{},["prevent"]))},{default:r(()=>[o(f,{label:"路径",prop:"path"},{default:r(()=>[m(o(u,{modelValue:i(V).path,"onUpdate:modelValue":e[0]||(e[0]=a=>i(V).path=a),icon:"icon-file_mode",name:"path",onIconClick:w,placeholder:"请选择数据库文件",width:"28rem"},null,8,["modelValue"]),[[b]])]),_:1}),o(f,{label:"名称"},{default:r(()=>[o(_,{width:"28rem",modelValue:i(V).name,"onUpdate:modelValue":e[1]||(e[1]=a=>i(V).name=a),placeholder:"可以不填写,默认为数据库文件名"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])])}}}),[["__scopeId","data-v-9fe42e36"]]);export{g as default};
Save File
Cancel